@extends('layouts.admin')
@section('title') @parent 圈子帖子列表 @stop
@section('page_title')@parent
圈子帖子列表
@show
@section('breadcrumb')@parent
{{ Breadcrumbs::render('circle-index')  }}
@show
@section('content')
<div class="box">
		<div class="box-header">
			<h3 class="box-title">圈子{{$circle->group_name}}的帖子</h3>
		</div>
		<div class="box-body table-responsive">	
				@include('widgets.notification')
				<div class="pad">
					
				</div>
				
				<table class="table table-bordered table-hover dataTable">
					<thead>
					<tr>
						<th>编号</th>
						<th>标题</th>
						<th>发帖人</th>
						<th>类别</th>
						<th>推荐</th>
						<th>置顶</th>
						<th>操作</th>
					</tr>
					</thead>
					<tbody>
							@if(count($posts)>0)
							@foreach ($posts as $item)
							<tr>
								<td>{{ $item->id }}</td>
								<td>{{ $item->title }}</td>
								<td>
									{{ $item->creatorName }}
								</td>
								<td>{{{ $item->post_category?$cateList[$item]:'' }}}</td>
								<td>{{{ $item->is_recommend ? '是':'否' }}}</td>
								<td>{{{ $item->is_top ? '是':'否' }}}</td>
								<td>
									<a href="{{ route('admin.circle.post.detail', [$circle->id, $item->id]) }}">详情</a>&nbsp;&nbsp;
									<a href="{{ route('admin.circle.post.setrecommend', [$circle->id, $item->id]) }}">{{{  $item->is_recommend?'取消':'设为' }}}推荐</a>&nbsp;&nbsp;
									<a href="{{ route('admin.circle.post.settop', [$circle->id, $item->id]) }}">{{{  $item->is_recommend?'取消':'设为' }}}推荐</a>&nbsp;&nbsp;
									<a title="删除" href="{{ route('admin.circle.post.remove', [$circle->id, $item->id]) }}" onclick="return confirm('确定要删除该帖子么？')" class="btn-del">&nbsp;&nbsp;<span class="glyphicon glyphicon-remove danger"></span></a>
								</td>
							</tr>
							@endforeach
							@endif
					</tbody>
				</table>
		</div>
		<div class="box-footer clearfix">
			{{ $posts->appends(Input::except('page'))->links() }}
		</div>
</div>
@stop
@section('end') @parent
@stop